home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / MVWIN.C < prev    next >
Text File  |  1992-11-21  |  1KB  |  55 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef mvwin
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_mvwin = "$Header: c:/curses/portable/RCS/mvwin.c%v 2.0 1992/11/15 03:29:01 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   mvwin()      - move window
  15.  
  16.   X/Open Description:
  17.        
  18.  
  19.   PDCurses Description:
  20.        There is no additional PDCurses functionality.
  21.  
  22.   X/Open Return Value:
  23.        The mvwin() routine returns OK on success and otherwise ERR
  24.        is returned.
  25.  
  26.   PDCurses Errors:
  27.        It is an error to call this function with a NULL window pointer.
  28.        It is also an error to address a position that is outside the
  29.        bounds of the specified window.
  30.  
  31.   Portability:
  32.        PDCurses        int mvwin( WINDOW* win, int y, int x );
  33.        X/Open Dec '88  int mvwin( WINDOW* win, int y, int x );
  34.        BSD Curses      int mvwin( WINDOW* win, int y, int x );
  35.        SYS V Curses    int mvwin( WINDOW* win, int y, int x );
  36.  
  37. **man-end**********************************************************************/
  38.  
  39. int    mvwin(WINDOW *win, int y, int x)
  40. {
  41.        if (win == (WINDOW *)NULL)
  42.                return( ERR );
  43.  
  44.        if (win->_begy + win->_maxy > LINES)
  45.                return( ERR );
  46.  
  47.        if (win->_begx + win->_maxx > COLS)
  48.                return( ERR );
  49.  
  50.        win->_begy = y;
  51.        win->_begx = x;
  52.        touchwin(win);
  53.        return( OK );
  54. }
  55.